package com.example.controller;

import com.example.entity.PsUser;
import com.example.service.PsUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin(origins = "*", maxAge = 3600)
@RestController
@Slf4j
public class PsusercinfigControllers {
    @Autowired
    private PsUserService psUserService;

    @PostMapping("/updateuser")
    public boolean updateuser(PsUser psUser){
        return  psUserService.updateuser(psUser);
    }

    @GetMapping("/selectpsuser")
    public PsUser selectfrom(Integer id){
        return psUserService.getById(id);
    }
}
